Skip to content

ttx service: timeout via context - part 1 #1028

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 16, 2025
Merged

ttx service: timeout via context - part 1 #1028

merged 7 commits into from
Apr 16, 2025

Conversation

sreenidhidrIBM
Copy link
Contributor

No description provided.

Signed-off-by: SREENIDHI DR <[email protected]>
Signed-off-by: SREENIDHI DR <[email protected]>
Signed-off-by: sreenidhi <[email protected]>
if err != nil {
span.RecordError(err)
return nil, errors.WithMessage(err, "failed to read audit event")
}
if len(signature) == 0 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this check needed? it might be misleading as to what is expected from the code if this can't happen. normally I expect that if err == nil, there data is valid.


msg, err := ReadMessage(context.Session(), time.Minute*4)
jsonSession := session2.JSON(context)
msg, err := jsonSession.ReceiveRawWithTimeout(time.Minute * 4)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could also extract these durations to constants, depending on what we are waiting for, e.g. signatureRcvTimeout, txRcvTimeout, to make sure we are aligned and to have a better overview. ideally I would even add them as fields in the structure objects and set the default values in the constructors.

Copy link
Contributor

@alexandrosfilios alexandrosfilios left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor comments to address

Signed-off-by: sreenidhi <[email protected]>
@adecaro adecaro mentioned this pull request Apr 16, 2025
@adecaro adecaro changed the title Issue915 clean ttx service: timeout via context Apr 16, 2025
@adecaro adecaro linked an issue Apr 16, 2025 that may be closed by this pull request
@adecaro adecaro self-assigned this Apr 16, 2025
@adecaro adecaro changed the title ttx service: timeout via context ttx service: timeout via context - part 1 Apr 16, 2025
@adecaro adecaro self-requested a review April 16, 2025 08:40
Copy link
Contributor

@adecaro adecaro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@adecaro adecaro merged commit 113ff9b into main Apr 16, 2025
54 checks passed
@adecaro adecaro deleted the issue915-clean branch April 16, 2025 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ttx service: timeout via context
3 participants